import type { RouteRecordRaw } from 'vue-router';
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单与面包屑的标题
 *      hidden：        是否隐藏菜单此路由
 *      icon：          菜单标题左侧的图标
 * }
 */
//目前模版项目中的全部的路由
//login登录页面-    一级路由
//404页面--        一级路由
//任意路由---      一级路由重定向404
//根路由 ---一级路由(layout/index.vue)
export const staticRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index.vue'),
      meta: {
        title: '首页',
        icon: 'ele-HomeFilled',

      }
    }]
  },
  {
    name: 'Acl',
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    redirect: '/acl/user/list',
    meta: { title: '权限管理', icon: 'ele-Setting' },
    children: [
      {
        name: 'User',
        path: '/acl/user/list',
        component: () => import('@/views/acl/user/index.vue'),
        meta: { title: '用户管理' }
      },
      {
        name: 'Role',
        path: '/acl/role/list',
        component: () => import('@/views/acl/role/index.vue'),
        meta: {
          title: '角色管理',
        },
      },
      {
        name: 'RoleAuth',
        path: '/acl/role/auth',
        component: () => import('@/views/acl/role/roleAuth.vue'),
        meta: {
          title: '角色管理',
          hidden: true,
          activeMenu: '/acl/role/list',
        },
      },
      {
        name: 'Permission',
        path: '/acl/permission/list',
        component: () => import('@/views/acl/permission/index.vue'),
        meta: {
          title: '菜单管理',
        }
      }
    ]
  }
  ,

  {
    path: '/product',
    component: () => import('@/layout/index.vue'),
    name: 'Product',
    meta: {
      title: '商品管理',
      icon: 'ele-Goods'
    },
    children: [
      {
        name: 'Trademark',
        path: 'trademark',
        component: () => import('@/views/product/trademark/index.vue'),
        meta: {
          title: '品牌管理',
          icon: 'ele-Handbag'
        }
      },
      {
        name: 'Attr',
        path: 'attr',
        component: () => import('@/views/product/attr/index.vue'),
        meta: {
          title: '属性管理',
          icon: 'ele-ChromeFilled'
        }
      },
      {
        name: 'Spu',
        path: 'spu',
        component: () => import('@/views/product/spu/index.vue'),
        meta: {
          title: 'SPU管理',
          icon: 'ele-SwitchFilled'
        }
      }
      ,
      {
        name: 'Sku',
        path: 'sku',
        component: () => import('@/views/product/sku/index.vue'),
        meta: {
          title: 'SKU管理',
          icon: 'ele-ElemeFilled'
        }
      }
    ]
  }
  ,

  /* 匹配任意的路由 必须最后注册 */
  {
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/404',
    meta: {
      hidden: true
    }
  }
];


